goto restore_out;
}
+ force_iommu = 1;
+
genapic = apic_x2apic_probe();
printk("Switched to APIC driver %s.\n", genapic->name);
{
INIT_LIST_HEAD(&amd_iommu_head);
+ if ( !iommu_enable && !iommu_intremap )
+ return 0;
+
if ( (amd_iommu_detect_acpi() !=0) || (iommu_found() == 0) )
{
printk("AMD-Vi: IOMMU not found!\n");
+ iommu_intremap = 0;
return -ENODEV;
}
* no-intremap Disable VT-d Interrupt Remapping
*/
custom_param("iommu", parse_iommu_param);
-bool_t __read_mostly iommu_enabled = 1;
+bool_t __initdata iommu_enable = 1;
+bool_t __read_mostly iommu_enabled;
bool_t __read_mostly force_iommu;
bool_t __initdata iommu_dom0_strict;
bool_t __read_mostly iommu_verbose;
*ss = '\0';
if ( !parse_bool(s) )
- iommu_enabled = 0;
+ iommu_enable = 0;
else if ( !strcmp(s, "force") || !strcmp(s, "required") )
force_iommu = val;
else if ( !strcmp(s, "workaround_bios_bug") )
if ( iommu_dom0_strict )
iommu_passthrough = 0;
- if ( iommu_enabled )
+ if ( iommu_enable )
{
rc = iommu_hardware_setup();
iommu_enabled = (rc == 0);
if ( !iommu_enabled )
{
iommu_snoop = 0;
- iommu_qinval = 0;
- iommu_intremap = 0;
iommu_passthrough = 0;
iommu_dom0_strict = 0;
}
dmar = (struct acpi_table_dmar *)table;
dmar_flags = dmar->flags;
- if ( !iommu_enabled )
+ if ( !iommu_enable && !iommu_intremap )
{
ret = -EINVAL;
goto out;
struct acpi_drhd_unit *drhd;
int apic;
- if ( !iommu_enabled || !iommu_qinval || !iommu_intremap ||
- list_empty(&acpi_drhd_units) )
+ if ( !iommu_qinval || !iommu_intremap || list_empty(&acpi_drhd_units) )
return 0;
/* We MUST have a DRHD unit for each IOAPIC. */
int ret;
if ( list_empty(&acpi_drhd_units) )
- return -ENODEV;
+ {
+ ret = -ENODEV;
+ goto error;
+ }
platform_quirks_init();
#include <public/hvm/ioreq.h>
#include <public/domctl.h>
-extern bool_t iommu_enabled;
+extern bool_t iommu_enable, iommu_enabled;
extern bool_t force_iommu, iommu_verbose;
extern bool_t iommu_workaround_bios_bug, iommu_passthrough;
extern bool_t iommu_snoop, iommu_qinval, iommu_intremap;